﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MainLayout.master" AutoEventWireup="false" CodeFile="HostControl.aspx.vb" Inherits="HostControl" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table>
        <tr>
            <td bgcolor="#66FF33">Host Control</td>
        </tr>
        <tr>
            <td>
                <asp:ListView ID="ListView1" runat="server" DataKeyNames="CreatedDate" DataSourceID="SqlDataSource1" EnableModelValidation="True" InsertItemPosition="LastItem">
                    <AlternatingItemTemplate>
                        <tr style="background-color: #FAFAD2;color: #284775;">
                            <td>
                                <asp:Label ID="ValidLatitudeLabel" runat="server" Text='<%# Eval("ValidLatitude")%>' />
                            </td>
                            <td>
                                <asp:Label ID="ValidLongitudeLabel" runat="server" Text='<%# Eval("ValidLongitude")%>' />
                            </td>
                            <td>
                                <asp:Label ID="AddedSecurityLabel" runat="server" Text='<%# Eval("AddedSecurity")%>' />
                            </td>
                            <td>
                                <asp:Label ID="AddedPasswordLabel" runat="server" Text='<%# Eval("AddedPassword")%>' />
                            </td>
                            <td>
                                <asp:Label ID="CreatedDateLabel" runat="server" Text='<%# Eval("CreatedDate") %>' />
                            </td>
                            <td>
                                <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        <tr style="background-color: #FFCC66;color: #000080;">
                            <td>
                                <asp:TextBox ID="ValidLatitudeTextBox" runat="server" Text='<%# Bind("ValidLatitude")%>' />
                            </td>
                            <td>
                                <asp:TextBox ID="ValidLongitudeTextBox" runat="server" Text='<%# Bind("ValidLongitude")%>' />
                            </td>
                            <td>
                                <asp:TextBox ID="AddedSecurityTextBox" runat="server" Text='<%# Bind("AddedSecurity")%>' ToolTip="Only 0(No) or 1(Yes)" />
                            </td>
                            <td>
                                <asp:TextBox ID="AddedPasswordTextBox" runat="server" Text='<%# Bind("AddedPassword")%>' ToolTip="Accept alpha numeric" />
                            </td>
                            <td>
                                <asp:Label ID="CreatedDateLabel1" runat="server" Text='<%# Eval("CreatedDate") %>' />
                            </td>
                            <td>
                                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                            </td>                            
                        </tr>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <table runat="server" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                            <tr>
                                <td>No data was returned.</td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <tr style="">
                            <td>
                                <asp:TextBox ID="ValidLatitudeTextBox" runat="server" Text='<%# Bind("ValidLatitude")%>' />
                            </td>
                            <td>
                                <asp:TextBox ID="ValidLongitudeTextBox" runat="server" Text='<%# Bind("ValidLongitude")%>' />
                            </td>
                            <td>
                                <asp:TextBox ID="AddedSecurityTextBox" runat="server" Text='<%# Bind("AddedSecurity")%>' ToolTip="Only 0  (No) or 1 (Yes)" />
                            </td>
                            <td>
                                <asp:TextBox ID="AddedPasswordTextBox" runat="server" Text='<%# Bind("AddedPassword")%>' ToolTip="Accept alpha numeric" />
                            </td>
                            <td>
                                <asp:TextBox ID="CreatedDateTextBox" runat="server" Text='<%# Bind("CreatedDate") %>' ReadOnly="True" />
                            </td>
                            <td>
                                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                            </td>
                        </tr>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <tr style="background-color: #FFFBD6;color: #333333;">

                            <td>
                                <asp:Label ID="ValidLatitudeLabel" runat="server" Text='<%# Eval("ValidLatitude") %>' />
                            </td>
                            <td>
                                <asp:Label ID="ValidLongitudeLabel" runat="server" Text='<%# Eval("ValidLongitude") %>' />
                            </td>
                            <td>
                                <asp:Label ID="AddedSecurityLabel" runat="server" Text='<%# Eval("AddedSecurity") %>' />
                            </td>
                            <td>
                                <asp:Label ID="AddedPasswordLabel" runat="server" Text='<%# Eval("AddedPassword") %>' />
                            </td>
                            <td>
                                <asp:Label ID="CreatedDateLabel" runat="server" Text='<%# Eval("CreatedDate") %>' />
                            </td>
                            <td>
                                <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <table runat="server">
                            <tr runat="server">
                                <td runat="server">
                                    <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                        <tr runat="server" style="background-color: #FFFBD6;color: #333333;">
                                            <th runat="server">Latitude</th>
                                            <th id="Th3" runat="server">Longitude</th>
                                            <th id="Th5" runat="server">Extra Security (0/1)</th>
                                            <th id="Th6" runat="server">Security Password</th>
                                            <th runat="server">Created Date</th>
                                            <th id="Th1" runat="server">Action</th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr runat="server">
                                <td runat="server" style="text-align: center;background-color: #FFCC66;font-family: Verdana, Arial, Helvetica, sans-serif;color: #333333;">
                                    <asp:DataPager ID="DataPager1" runat="server">
                                        <Fields>
                                            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                            <asp:NumericPagerField />
                                            <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                        </Fields>
                                    </asp:DataPager>
                                </td>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <tr style="background-color: #FFCC66;font-weight: bold;color: #000080;">
                            <td>
                                <asp:Label ID="ValidLatitudeLabel" runat="server" Text='<%# Eval("ValidLatitude")%>' />
                            </td>
                            <td>
                                <asp:Label ID="ValidLongitudeLabel" runat="server" Text='<%# Eval("ValidLongitude")%>' />
                            </td>
                            <td>
                                <asp:Label ID="AddedSecurityLabel" runat="server" Text='<%# Eval("AddedSecurity")%>' />
                            </td>
                            <td>
                                <asp:Label ID="AddedPasswordLabel" runat="server" Text='<%# Eval("AddedPasswordLabel")%>' />
                            </td>
                            <td>
                                <asp:Label ID="CreatedDateLabel" runat="server" Text='<%# Eval("CreatedDate") %>' />
                            </td>
                            <td>
                                <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                            </td>
                        </tr>
                    </SelectedItemTemplate>
                </asp:ListView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TESTREMConnectionString %>" DeleteCommand="DELETE FROM [AW_ValidHost] WHERE [CreatedDate] = @original_CreatedDate" InsertCommand="INSERT INTO [AW_ValidHost] ([ValidLatitude],[ValidLongitude],[AddedSecurity],[AddedPassword]) VALUES (@ValidLatitude,@ValidLongitude,@AddedSecurity,@AddedPassword)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [ValidLatitude],[ValidLongitude],[AddedSecurity],[AddedPassword], [CreatedDate] FROM [AW_ValidHost]" UpdateCommand="UPDATE [AW_ValidHost] SET [ValidLatitude] = @ValidLatitude,[ValidLongitude]=@ValidLongitude,[AddedSecurity]=@AddedSecurity,[AddedPassword]=@AddedPassword WHERE [CreatedDate] = @original_CreatedDate">
                    <DeleteParameters>
                        <asp:Parameter Name="original_CreatedDate" Type="DateTime" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="ValidLatitude" Type="Double" />
                        <asp:Parameter Name="ValidLongitude" Type="Double" />
                        <asp:Parameter Name="AddedSecurity" Type="Int16" />
                        <asp:Parameter Name="AddedPassword" Type="String" />
                        <asp:Parameter Name="CreatedDate" Type="DateTime" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="ValidLatitude" Type="Double" />
                        <asp:Parameter Name="ValidLongitude" Type="Double" />
                        <asp:Parameter Name="AddedSecurity" Type="Int16" />
                        <asp:Parameter Name="AddedPassword" Type="String" />
                        <asp:Parameter Name="original_CreatedDate" Type="DateTime" />
                    </UpdateParameters>
                </asp:SqlDataSource>

            </td>
        </tr>
    </table>
    <br />
    <br />

    <table>
        <tr>
            <td bgcolor="#FF3300">Invalid Host Intrusion</td>
        </tr>
        <tr><td><asp:Label runat="server" ID="Label1">Show Records:</asp:Label><asp:TextBox ID="TextBox1" runat="server">200</asp:TextBox><asp:Button ID="QueryBtn" runat="server" Text="Click To Query" /></td></tr>
        <tr><td>
                <asp:ListView ID="ListView2" runat="server" DataSourceID="ObjectDataSource1" EnableModelValidation="True">
                <LayoutTemplate>
                    <table id="Table1" runat="server">
                        <tr id="Tr1" runat="server">
                            <td id="Td1" runat="server">
                                <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                    <tr id="Tr2" runat="server">
                                        <th id="Th1" runat="server">Invalid Latitude</th>
                                        <th id="Th4" runat="server">Invalid Longitude</th>
                                        <th id="Th2" runat="server">Date</th>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr id="Tr3" runat="server">
                            <td id="Td2" runat="server" style="text-align: center; background-color: #FFCC66; font-family: Verdana, Arial, Helvetica, sans-serif; color: #333333;">
                                <asp:DataPager ID="DataPager1" runat="server" PageSize="30">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                        <asp:NumericPagerField />
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                    </table>

                </LayoutTemplate>
                <EmptyDataTemplate>
                    <table id="Table2" runat="server" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;">
                        <tr>
                            <td>No data was returned.</td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <ItemTemplate>

                    <tr style="background-color: #FFFBD6; color: #333333;">
                        <td>
                            <asp:Label ID="CollectionTypeLabel" runat="server"
                                Text='<%# Eval("InvalidLatitude")%>' />
                        </td>
                        <td>
                            <asp:Label ID="Label2" runat="server"
                                Text='<%# Eval("InvalidLongitude")%>' />
                        </td>
                        <td>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("CreatedDate")%>' />
                        </td>
                    </tr>

                </ItemTemplate>
                <SelectedItemTemplate>
                    <tr style="background-color: #FFCC66; font-weight: bold; color: #000080;">
                    </tr>
                </SelectedItemTemplate>
            </asp:ListView>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="retrieveInvalidHost" TypeName="Impl.LoginCollection">
                <SelectParameters>
                    <asp:ControlParameter ControlID="TextBox1" DefaultValue="200" Name="noRecord" PropertyName="Text" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
            </td>
        </tr>
    </table>
</asp:Content>

